// Copyright 2021 Guoyoko. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "Modules/ModuleInterface.h"
#include "Framework/Commands/UICommandList.h"
#include "Framework/Docking/TabManager.h"


class FSWLevelEditorTabIds
{
public:
	static const FName ToolBar;/*-> ToolBar Docktab*/
	static const FName Viewport;/*-> Viewport Docktab*/
	static const FName PlaceActorsBrowser;/*-> Placement Actor Docktab*/
	static const FName SelectionDetails;/*-> Details Docktab*/

	/* ...*/
};

class FSWLevelEditorModule : public IModuleInterface
{

public:
	virtual void StartupModule();

	virtual void ShutdownModule();

	/* Create a tab manager for the level editor based on the given tab (or clears the tab manager if OwnerTab is null) */
	void SetLevelEditorTabManager(const TSharedPtr<SDockTab>& OwnerTab);

	/* @return The pointer to the level editor tab manager */
	TSharedPtr<class FTabManager> GetLevelEditorTabManager() const;
	
	const TSharedRef<FUICommandList> GetLevelEditorCommandActionsList() const { return CommandActionsList.ToSharedRef(); }

private:
	/**
	 * Binds My level editor commands to delegates
	 */
	void BindLevelEditorCommands();

	/** Spawn the main level editor tab */
	TSharedRef< SDockTab> SpawnLevelEditor(const FSpawnTabArgs& InArgs);

private:

	TSharedPtr<class FUICommandList> CommandActionsList;

	TSharedPtr<class FTabManager> LevelEditorTabManager;

};